import request from '@/utils/request'

// 登录方法
export function login(data) {
  return request({
    url: '/user/index/pwdLogin',
    method: 'post',
    data: data
  })
}
export function phoneLogin(data) {
  return request({
    url: '/user/index/phoneLogin',
    method: 'post',
    data: data
  })
}

// 发送验证码
export function sendCode(data) {
  return request({
    url: '/user/index/sendCode',
    method: 'post',
    data: data
  })
}

// 注册方法
export function register(data) {
  return request({
    url: '/user/index/register',
    method: 'post',
    data: data
  })
}

// 获取用户详细信息
export function getInfo() {
  return request({
    url: '/user/user/getUserInfo',
    method: 'get'
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/user/user/logout',
    method: 'post'
  })
}

// 获取验证码
export function getCodeImg() {
  return request({
    url: '/captchaImage',
    headers: {
      isToken: false
    },
    method: 'get',
    timeout: 20000
  })
}

// 找回密码
export function editPass(data) {
  return request({
    url: '/user/index/editPass',
    method: 'post',
    data: data
  })
}

// 修改密码
export function editPassword(data) {
  return request({
    url: '/user/user/editPassword',
    method: 'post',
    data: data
  })
}

// 财务明细
export function orderIndex() {
  return request({
    url: '/user/user/orderIndex',
    method: 'get'
  })
}

// 修改头像
export function editPhoto(data) {
  return request({
    url: '/user/user/editPhoto',
    method: 'post',
    data: data
  })
}